package top.haijunit.navi.auth.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import top.haijunit.framework.validation.ValidChecks;

import java.util.List;

/**
 * 【说明类功能】
 *
 * @author zhanghaijun
 * @since 2024-08-30
 */
@Data
public class PermissionRelationInfo extends PermissionInfo {

    /**
     * 权限互斥权限集合
     */
    @Schema(description = "权限互斥权限集合")
    @NotNull(message = "权限互斥权限集合不能为空", groups = {ValidChecks.GroupEdit.class, ValidChecks.GroupAdd.class})
    private List<RelationInfo> repelList;

    /**
     * 权限依赖权限集合
     */
    @Schema(description = "权限依赖权限集合")
    @NotNull(message = "权限依赖权限集合不能为空", groups = {ValidChecks.GroupEdit.class, ValidChecks.GroupAdd.class})
    private List<RelationInfo> dependList;


    /**
     * 权限关联信息
     */
    @Data
    @Schema(description = "权限关联信息")
    public static class RelationInfo {

        /**
         * 关联的权限编码
         */
        @Schema(description = "关联的权限编码")
        private Long permissionCode;

        /**
         * 权限关联备注
         */
        @Schema(description = "权限关联备注")
        private String remarks;
    }
}
